package com.xsr.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @author 邢式瑞
 * @version 1.0
 * @project zhujie
 * @date 2022/9/6 22:47
 */
@Component
@Aspect
public class DataAdvice {
@Pointcut("execution(boolean com.xsr.service.resourcesService.openURL(..))")
    private  void servicePt(){


}
public  Object trimStr(ProceedingJoinPoint pjp) throws Throwable {

    Object[] args = pjp.getArgs();
    for (int i = 0; i < args.length; i++) {
        if(args[i].getClass().equals(String.class)){

           args[i]= args[i].toString().trim();
        }
    }
        return pjp.proceed(args);
}
}
